package mobilesmil.adapter;

import java.util.ArrayList;

import mobilesmil.activity.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class SendAdapter extends ArrayAdapter<String>{
	private Context mContext;
	private ArrayList<String> mItems;
	
	public SendAdapter(Context context, int textViewResourceId, ArrayList<String> items) {
        super(context, textViewResourceId, items);
        this.mContext = context;
        this.mItems = items;
        
	}
	
	@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = convertView;
        final int pos = position;
        if (view == null) {
            LayoutInflater vi = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = vi.inflate(R.layout.send_list_row, null);
        }
        
        String name = mItems.get(position);
        if (name != null) 
        {
                TextView contactName = (TextView) view.findViewById(R.id.contactName);
                contactName.setText(name);
        }
        return view;
    }
}
